
#region Imports

using System;
using System.Messaging;
using System.Xml;

#endregion

namespace Justa.Messaging
{
    /// <summary>
    /// Messaging Utilities.
    /// </summary>
    /// 
    public sealed class MessagingUtils
    {
        /// <summary>
        /// 
        /// </summary>
        private MessagingUtils()
        {
        }

        /// <summary>
        /// Sends a response message to the response destination defined in the
        /// message header of the given message.
        /// </summary>
        /// 
        /// <param name="message"></param>
        /// 
        //public static void SendResponseMessage(Message message)
        //{
        //    message.Formatter = new System.Messaging.XmlMessageFormatter(new String[] { "System.String" });
        //    string body = message.Body.ToString();

        //    XmlDocument xmlDocument = new XmlDocument();
        //    xmlDocument.LoadXml(body);

        //    MessageQueue response = message.ResponseQueue;
        //    Message msg = new Message(xmlDocument.OuterXml);

        //    msg.CorrelationId = message.Id;

        //    if (response != null)
        //    {
        //        response.Send(msg);
        //    }
        //}
    }
}
